import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '承接任务',
    align:"center",
    dataIndex: 'undertaketasks',
     width:200
   },
   {
    title: '工作内容',
    align:"center",
    dataIndex: 'jobcontent',
     width:250
   },
   {
    title: '完成期限',
    align:"center",
    dataIndex: 'deadlineforcompletion',
     width:250
   },
   {
    title: '责任部门',
    align:"center",
    dataIndex: 'respondepart_dictText',
     width:250
   },
   {
    title: '配合部门',
    align:"center",
    dataIndex: 'coopDepart_dictText',
     width:250
   },
   {
    title: '配合内容',
    align:"center",
    dataIndex: 'coopcontent'
   },
   {
    title: '质量要求',
    align:"center",
    dataIndex: 'qualityrequirements',
     width:270
   },
  {
    title: '任务状态',
    align: "center",
    dataIndex: 'taskstatus',
    width:150
  }
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'id',
    field: 'id',
    component: 'Input',
  },
  {
    label: '承接任务',
    field: 'undertaketasks',
    component: 'Input',
  },
  {
    label: '工作内容',
    field: 'jobcontent',
    component: 'Input',
  },
  {
    label: '完成期限',
    field: 'deadlineforcompletion',
    component: 'DatePicker',
  },
  {
    label: '责任部门',
    field: 'respondepart',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sys_depart,depart_name,id"
     },
  },
  {
    label: '配合部门',
    field: 'coop_depart',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode:"sys_depart,depart_name,id"
    },
  },
  {
    label: '配合内容',
    field: 'coopcontent',
    component: 'Input',
  },
  {
    label: '质量要求',
    field: 'qualityrequirements',
    component: 'Input',
  },
  {
    label: '任务状态',
    field: 'taskstatus',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  id: {title: 'id',order: 0,view: 'text', type: 'string',},
  undertaketasks: {title: '承接任务',order: 1,view: 'text', type: 'string',},
  jobcontent: {title: '工作内容',order: 2,view: 'text', type: 'string',},
  deadlineforcompletion: {title: '完成期限',order: 3,view: 'datetime', type: 'string',},
  respondepart: {title: '责任部门',order: 4,view: 'text', type: 'string',dictTable: "sys_depart", dictCode: 'id', dictText: 'depart_name',},
  coopDepart: {title: '配合部门',order: 5,view: 'text', type: 'string',dictTable: "sys_depart where depart_name like '%部' or depart_name like '%处'", dictCode: 'id', dictText: 'depart_name',},
  coopcontent: {title: '配合内容',order: 6,view: 'text', type: 'string',},
  qualityrequirements: {title: '质量要求',order: 7,view: 'text', type: 'string',},
  taskstatus: {title: '任务状态',order: 8,view: 'text', type: 'string',}
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
